package org.streets.database;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;

/**
 * 
 * @author dzb
 * 
 */
@Entity
public class AnnotatedBean {

	@Basic
	private long id;

	@Column(name = "description")
	private String description;

	@Column
	private Date data;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Date getData() {
		return data;
	}

	public void setData(Date date) {
		this.data = date;
	}

	public String toString() {
		return id + " " + description + " " + data;
	}

	public static void main(String[] args) {
		Entity entity = AnnotatedBean.class.getAnnotation(Entity.class);
		System.out.println(entity);
		entity = Bean.class.getAnnotation(Entity.class);
		
		if (entity == null) {
			System.out.println("NULL");
		} else {
			System.out.println("NOTNULL");
		}
		System.out.println(entity);
	}
}
